#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int Sum(int n)
{
	int re = 0;
	if (n / 10)
		return re = n + Sum(n / 10);
	else
		return n;
}
int main()
{
	int a;
	scanf("%d", &a);
	int sum = 0;
	int n = a * 10000 + a * 1000 + a * 100 + a * 10 + a;
	sum=Sum(n);
	printf("%d", sum);
	return 0;
}